﻿/*
 * ©2009-2010 XELF
 * http://xelf.info
 */

#if XNA || WINDOWS_PHONE
using Microsoft.Xna.Framework;
#endif

namespace XELF.Framework {

#if XNA || WINDOWS_PHONE
	public static partial class Vector3Helper {
#else
	public partial struct Vector3 {
#endif
		/// <summary>
		/// スカラー三重積（平行六面体の符号付き体積）
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <param name="c"></param>
		/// <returns></returns>
		public static float ScalarTripleProduct(ref Vector3 a, ref Vector3 b, ref Vector3 c) {
			return
				(a.Y * b.Z - a.Z * b.Y) * c.X +
				(a.Z * b.X - a.X * b.Z) * c.Y +
				(a.X * b.Y - a.Y * b.X) * c.Z;
		}
	}

}

